import resultEnum from '../utils/resultEnum.js';
import Mocks from '../utils/mock.js';
const Mock = new Mocks();
/* 查询每日一拍图信息 */
export function selectAuctionImgInfo (ctx, next) {
  try {
    const params = {
      ...ctx.query
    };
    console.log(params);
    ctx.success(resultEnum.GET_SUCCESS.code, resultEnum.GET_SUCCESS.msg, Mock.getAuctionImgList())
  } catch (error) {
    ctx.error(resultEnum.GET_ERROR.code, resultEnum.GET_ERROR.msg)
  }
}

/* 查询预展信息 */
export function selectPreviewProductInfo (ctx, next) {
  try {
    const params = {
      ...ctx.query
    };
    console.log(params);
    console.log(Number(params.current) >= 6);
    if (Number(params.current) >= 6) {
      ctx.success(resultEnum.GET_SUCCESS.code, resultEnum.GET_SUCCESS.msg, Mock.getBlankInfo())
    } else {
      ctx.success(resultEnum.GET_SUCCESS.code, resultEnum.GET_SUCCESS.msg, Mock.getPriviewProductInfo())
    }
  } catch (error) {
    ctx.error(resultEnum.GET_ERROR.code, resultEnum.GET_ERROR.msg)
  }
}

// export default {
//   selectAuctionImgInfo,
//   selectPreviewProductInfo
// }